//
//  JZWHomeViewController.m
//  jiangzaiwai
//
//  Created by TomorJM on 2017/8/13.
//  Copyright © 2017年 WF. All rights reserved.
//

#import "JZWHomeViewController.h"
#import "UIViewController+LGSideMenuController.h"
#import <MAMapKit/MAMapKit.h>
#import <AMapFoundationKit/AMapFoundationKit.h>
#import "JZWLoginViewController.h"
#import "JZWNavigationViewController.h"

@interface JZWHomeViewController ()

@end

@implementation JZWHomeViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.title = @"将在外";
    self.view.backgroundColor = [UIColor whiteColor];
    
    UIButton *leftBtn = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, 30, 30)];
    [leftBtn setImage:[UIImage imageNamed:@"nav_left"] forState:UIControlStateNormal];
    [leftBtn addTarget:self action:@selector(showLeftView)];
    self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:leftBtn];
    
    self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"Test" style:UIBarButtonItemStylePlain target:self action:@selector(test)];
    
    
    
    [AMapServices sharedServices].enableHTTPS = YES;
    
    ///初始化地图
    MAMapView *_mapView = [[MAMapView alloc] initWithFrame:self.view.bounds];
    
    ///把地图添加至view
    [self.view addSubview:_mapView];
    
}


#pragma mark - click action

- (void)showLeftView {
    [self.sideMenuController showLeftViewAnimated:YES completionHandler:nil];
}

- (void)test {
    JZWNavigationViewController *nav = [[JZWNavigationViewController alloc] initWithRootViewController:[[JZWLoginViewController alloc] init]];
    [self presentViewController:nav animated:YES completion:nil];
}



@end
